﻿#region

using System.Data.Entity.ModelConfiguration;
using HouseHoldBudget.Core.Entities.Incomes;

#endregion

namespace HouseHoldBudget.Data.Mapping.Incomes
{
    public class FixedIncomeMap : EntityTypeConfiguration<FixedIncome>
    {
        #region Constructors

        public FixedIncomeMap()
        {
            ToTable("FixedIncomes");
            HasKey(p => p.Id);

            HasRequired(fp => fp.BudgetUser)
                .WithMany(p=>p.FixedIncomes)
                .HasForeignKey(fp => fp.BudgetUserId)
                .WillCascadeOnDelete(false);
        }

        #endregion
    }
}